class Point<T>{
    x: T
    y: T
    z?: T
    constructor(x: T,y: T,z?: T) {
        this.x = x
        this.y = y
        this.z = z
    }
}
let p1 = new Point(1,2,3);
let p2 = new Point<string>("1","2","3");
let p3: Point<number> = new Point(1,2);
console.log(p1)
console.log(p2)